﻿using System;
namespace Producers.Liiklusregister.Xtee.Riik.Ee.Producer.Liiklusregister {
    
    
    public partial class Treasury : global::Producers.Liiklusregister.Xtee.Riik.Ee.Producer.Liiklusregister.ITreasury {
        
        private Treasury.DocumentNumType @__documentNum;
        
        private Treasury.OrderNumType @__orderNum;
        
        private Treasury.BankRefType @__bankRef;
        
        public Treasury() {
        }
        
        /// <summary>
        /// All parameters
        /// </summary>
        public Treasury(Treasury.DocumentNumType @documentNum, Treasury.OrderNumType @orderNum, Treasury.BankRefType @bankRef) {
            this.@__documentNum = @documentNum;
            this.@__orderNum = @orderNum;
            this.@__bankRef = @bankRef;
        }
        
        /// <summary>
        /// Copy Constructor
        /// </summary>
        protected Treasury(ITreasury @treasury) {
            this.@__documentNum = @treasury.DocumentNum;
            this.@__orderNum = @treasury.OrderNum;
            this.@__bankRef = @treasury.BankRef;
        }
        
        public virtual Treasury.DocumentNumType DocumentNum {
            get {
                return this.@__documentNum;
            }
            set {
                this.@__documentNum = value;
            }
        }
        
        public virtual Treasury.OrderNumType OrderNum {
            get {
                return this.@__orderNum;
            }
            set {
                this.@__orderNum = value;
            }
        }
        
        public virtual Treasury.BankRefType BankRef {
            get {
                return this.@__bankRef;
            }
            set {
                this.@__bankRef = value;
            }
        }
        
        public class DocumentNumType : global::Xtee.Core.Schema.XsdString {
            
            public DocumentNumType(string value) : 
                    base(value) {
                this.PikkusSuuremVõrdneKui = 0;
                this.PikkusVaiksemVordneKui = 50;
                this.Validate();
            }
            
            public DocumentNumType() : 
                    base(string.Empty) {
            }
            
            public static bool TryParse(string value, out DocumentNumType result) {
                try {
                    result = new DocumentNumType(value);
                    return true;
                }
                catch (System.Exception ) {
                    result = null;
                    return false;
                }
            }
            
            public static implicit operator String (DocumentNumType value) {
                return value.Value;
            }
            
            public static implicit operator DocumentNumType (string value) {
                if (value==null) {
                    return null;
                }
                return new DocumentNumType(value);
            }
        }
        
        public class OrderNumType : global::Xtee.Core.Schema.XsdString {
            
            public OrderNumType(string value) : 
                    base(value) {
                this.PikkusSuuremVõrdneKui = 1;
                this.PikkusVaiksemVordneKui = 20;
                this.Validate();
            }
            
            public OrderNumType() : 
                    base(string.Empty) {
            }
            
            public static bool TryParse(string value, out OrderNumType result) {
                try {
                    result = new OrderNumType(value);
                    return true;
                }
                catch (System.Exception ) {
                    result = null;
                    return false;
                }
            }
            
            public static implicit operator String (OrderNumType value) {
                return value.Value;
            }
            
            public static implicit operator OrderNumType (string value) {
                if (value==null) {
                    return null;
                }
                return new OrderNumType(value);
            }
        }
        
        public class BankRefType : global::Xtee.Core.Schema.XsdString {
            
            public BankRefType(string value) : 
                    base(value) {
                this.PikkusSuuremVõrdneKui = 0;
                this.PikkusVaiksemVordneKui = 20;
                this.Validate();
            }
            
            public BankRefType() : 
                    base(string.Empty) {
            }
            
            public static bool TryParse(string value, out BankRefType result) {
                try {
                    result = new BankRefType(value);
                    return true;
                }
                catch (System.Exception ) {
                    result = null;
                    return false;
                }
            }
            
            public static implicit operator String (BankRefType value) {
                return value.Value;
            }
            
            public static implicit operator BankRefType (string value) {
                if (value==null) {
                    return null;
                }
                return new BankRefType(value);
            }
        }
    }
}
